package com.bjtu.lms.action.user;

import com.bjtu.lms.model.Book;
import com.bjtu.lms.service.UserService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import java.util.List;
import java.util.Map;

/**
 *
 * @author yilee
 */
public class ViewUserListAction extends ActionSupport {

	private UserService userService;

	public UserService getUserService() {
		return userService;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	@Override
	public String execute() throws Exception {
		List<Book> userList = userService.getAllUser();
		ActionContext actionContext = ActionContext.getContext();
		Map session = actionContext.getSession();
		session.put("userList", userList);
		return SUCCESS;
	}
}
